package com.cenwangkeji.resident.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.bean.SignBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * @松 on 2019/10/28 13:18
 * 签约适配器
 */
public class SignAdapter extends BaseQuickAdapter<SignBean.DataBean, BaseViewHolder> {

    public SignAdapter( @Nullable List<SignBean.DataBean> data) {
        super(R.layout.item_sign, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SignBean.DataBean item) {
        if (item.getStatus()==2){
            helper.getView(R.id.tv_state).setVisibility(View.VISIBLE);
        }else {
            helper.getView(R.id.tv_state).setVisibility(View.INVISIBLE);

        }
        helper.addOnClickListener(R.id.tv_state);
        helper.setText(R.id.tv_name,"姓名："+item.getXm());
        helper.setText(R.id.tv_phone,"电话："+item.getBrdh());
        helper.setText(R.id.tv_area,"隶属："+item.getJd());
        helper.setText(R.id.tv_hospital,"社区医院："+item.getSqyy());
        helper.setText(R.id.tv_doctor,"签约医生："+item.getQyys());
        helper.setText(R.id.tv_date,"签约日期："+item.getQyrq());
    }
}
